/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dinner.web;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 
 * @author Bizon
 */
public class ReportLine implements Serializable {

	private static final long serialVersionUID = 400123720005968074L;

	public static ReportLine createLine(Eat e, String userName) {
		return new ReportLine(e.getName(), e.getPrice(), e.getPieces(), new ArrayList<String>(Arrays.asList(new String[] { userName })));
	}

	private String name;
	private double price;
	private int count;

	private List<String> userList;

	public ReportLine() {
		// TODO Auto-generated constructor stub
	}

	public ReportLine(String name, double price, int count, List<String> userList) {
		super();
		this.name = name;
		this.price = price;
		this.count = count;
		this.userList = userList;
	}

	public int getCount() {
		return count;
	}

	public String getName() {
		return name;
	}

	public double getPrice() {
		return price;
	}

	public List<String> getUserList() {
		return userList;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public void setUserList(List<String> userList) {
		this.userList = userList;
	}

	@Override
	public String toString() {
		return "ReportLine [count=" + count + ", name=" + name + ", price=" + price + ", userList=" + userList + "]";
	}

}
